package com.foreveross.proxyip.monitor.domain;

import java.util.ArrayList;
import java.util.List;

import com.foreveross.proxyip.entity.ChannelEntity;
import com.foreveross.proxyip.infra.InstanceFactory;
import com.foreveross.proxyip.monitor.infra.ChannelRepository;
import com.foreveross.proxyip.monitor.infra.RealTimeSearchRepository;

/**
 * 渠道领域对象
 * @author Administrator
 *
 */
public class Channel {
	
	private static ChannelRepository repository;
	
	private static ChannelRepository getRepository(){
		if(repository==null){
			repository=InstanceFactory.getInstance(ChannelRepository.class);
		}
		return repository;
	}
	
	/**
	 * 获取所有的渠道
	 * @return
	 * @throws Exception 
	 */
	public static List<ChannelEntity> getAllChannels() throws Exception{
		
		return getRepository().getAllChannels();
	}
	
}
